'''
@project:tinyshop
@auther:sh
@file:a4.py
@date:2022/11/8 19:48
@desc:
'''
from selenium import webdriver
import time
from selenium.webdriver.common.by import By
import unittest
from common.broswersetting import broswersetting

class dd_ddfh(broswersetting):
    #订单中心 发货
    # @unittest.skip
    def test_fh1(self):
        self.tiny_htzh('admin', '123456', 'aaaa')
        self._testMethodName='订单发货成功'
        self.ddfh('1111111')
        self.driver.switch_to.window(self.driver.window_handles[-1])
        try:
            self.assertIn('已发货' ,self.driver.page_source)

        except Exception as e:
            self.driver.get_screenshot_as_file('F:\\csxm\\tinyshop_t174\\images\\' + self._testMethodName + '.png')
            raise


    # 订单中心 发货
    # @unittest.skip
    def test_fh2(self):
        self.tiny_htzh('admin', '123456', 'aaaa')
        self._testMethodName = '未填单号发货'
        self.ddfh1()
        self.driver.switch_to.window(self.driver.window_handles[-1])
        try:
            self.assertIn('已发货',self.driver.title)

        except Exception as e:
            self.driver.get_screenshot_as_file('F:\\csxm\\tinyshop_t174\\images\\' + self._testMethodName + '.png')
            raise
if __name__ == '__main__':
    unittest.main()
